package com.flitsneak.designpatterns.creationalpatterns.singleton;

/**
 * Author: flitsneak
 * Date: 2022/5/31 14:14
 * Description: 静态内部类单例模式
 */
public class StaticInnerClassSingleton {
    private StaticInnerClassSingleton() {
    }

    private static class SingletonHolder {
        private static final StaticInnerClassSingleton staticInnerClassSingleton = new StaticInnerClassSingleton();
    }

    public static StaticInnerClassSingleton getStaticInnerClassSingleton() {
        return SingletonHolder.staticInnerClassSingleton;
    }
    //其他业务逻辑
}
